All Questions
11 questions
2votes
1answer
191views
follow-up - Checking Nested Bracket Levels in Strings Programming Challenge
A follow-up to this question, this post improves on test case issues. To restate problem parameters, a given string S is considered closed if it: Has a matching ...
2votes
2answers
361views
Exercism: determine if a word or phrase is an isogram
The task: Determine if a word or phrase is an isogram. An isogram (also known as a "nonpattern word") is a word or phrase without a repeating letter, however spaces and hyphens are allowed ...
3votes
1answer
2kviews
Find and return the earliest occurring word from a string which contains the most repeating letters
I'd like feedback on my solution to the outlined programming challenge (medium level). I've tried it fast in any way I know how to, but, what might be a more efficient and/or pythonic solution? [...
3votes
1answer
3kviews
Run length encoding of an input string (Coderbyte 'Run Length' challenge)
I'd like feedback on my solution to the outlined (medium level) programming challenge. What might be a more efficient or Pythonic solution? The challenge as outlined by Coderbyte: [Run Length] (...
1vote
1answer
5kviews
String Rotation
I have solved a previous year question of 2018 codevita (link) in Python. Problem Description: Rotate a given String in the specified direction by specified magnitude. After each rotation make a ...
4votes
1answer
516views
Find the first non-recurring character in string
I wrote a solution to first-unique-character-in-a-string: Given a string, find the first non-repeating character in it and return its index. If it doesn't exist, return -1. If there is better way ...
2votes
1answer
1kviews
Find a substring count in an string
This code is written to find substring count in a string in Python 3. The original problem description is here. Please suggest better ways of solving this. ...
3votes
2answers
262views
Largest substring which starts and ends with some substring
This code is meant to find the length of the largest substring within a string that starts and ends with a given non-empty substring. Here are some examples: ...
6votes
2answers
930views
Reduce as many adjacent chars as possible in string
This code is meant to reduce a given string as much as possible by deleting adjacent characters. Here are some examples: ...
3votes
1answer
2kviews
Hackerrank Funny String python solution
"Funny String" problem from Hackerrank Suppose you have a String, \$S\$ of length \$N\$ indexed from \$0\$ to \$N-1\$. You also have some String, \$R\$, that is the reverse of \$S\$, where \$S\$ is ...
5votes
5answers
3kviews
Number of sub strings with same first and last character
Problem Statement: You are given a function \$f(x)\$, where \$f(x)\$ is \$1\$ if the first and last characters of string \$x\$ are equal; else it is \$0\$. You are given a string \$S\$ and you ...